package com.simon.api.zsortset;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Tuple;

import java.util.Set;

/**
 * Created by changf on 2017/7/7.
 */
public class WangZhePaihang {
    public static void main(String[] args) throws Exception{
        Jedis jedis=new Jedis("192.168.112.12",6379);

        int i=1;
        while(true){
            //排行榜

            Thread.sleep(3000);
            System.out.println("第" + i + "次查看榜单-----------");

            Set<Tuple> strings = jedis.zrevrangeWithScores("hero:pipei", 0, 4);
            for (Tuple s:strings){
                System.out.println(s.getElement() + "   " + s.getScore());
            }
            i++;
            System.out.println();
            System.out.println();
            System.out.println();

        }



    }
}
